home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 2 / BBS in a box - Trilogy II.iso / Files / Hyper / U-Z / WindowScript™.Demo / WindowScript™ 1.0 Working Model / WindowScript™ 1.0 Working Model.rsrc / ljb_129_Scripter < prev    next >
Encoding:
Text File  |  1992-04-29  |  4.5 KB  |  38 lines

  1. ItemType: WIND
  2. Rect: 90,93,550,293
  3. Style: Window
  4. HasTitleBar: TRUE
  5. HasZoomBox: TRUE
  6. HasCloseBox: TRUE
  7. HasGrowBox: TRUE
  8. MinSize: 200,100
  9. MaxSize: 512,340
  10. Name: Scripter
  11. Script: --on wEvent wdID,wdName,objNo,objName,objValue¬global CR, gWindow, itemShown, typeShown,WSS¬if objNo = 0 then¬  if objValue = "Close" then¬    if wsGet(wdID,0,"xOldScript") <> wsGet(wdID,"theScript","TEXT") then¬      get line 1 of WindowScript("Saver", "Save changes to script before closing?")¬      if it is "Save" then¬        doSaveScript wdName¬        return the Result¬      else if it is empty then¬        return "NG"¬      end if¬    end if¬    menuSet "Go",wdName,"NAME",""¬  else if objValue = "Open" then¬    get menuGet("Go",0,"TEXT")¬    menuSet "Go",0,"TEXT", wdName & CR & it¬  else if objValue = "Suspend" then¬    menuSet "Go",wdName,"CHECKMARK",FALSE¬  else if objValue = "Resume" then¬    menuSet "Go",wdName,"CHECKMARK",TRUE¬  end if¬else if objNo = -1 then¬  put wdID into windowID¬  if objName=numtochar(20) and objNo=1 then¬    doSplash¬  else if objValue = "About WindowScript…" then¬    doSplash¬  else if objValue = "Close Script" then¬    wsSend windowID,0,"Close"¬  else if objValue = "Revert to Saved" then¬    if confirmRef(wdName) is not true then return "NG"¬    put wsGet(windowID,0,xOwnerID) into oID¬    put wsGet(windowID,0,xOwnerNumber) into oNumber¬    wsSet windowID,"theScript","TEXT",wsGet(windowID,0,xOldScript)¬  else if objValue = "Save Script" then¬    doSaveScript wdName¬  else if objValue = "Page Setup…" then¬    doMenu "Page Setup..."¬  else if objValue = "Print Script…" then¬    print wsGet(windowID,"theScript","TEXT")¬  else if objValue = "Quit HyperCard" then¬    doMenu "Quit HyperCard"¬  else if objValue = "Select All" then¬    wsSet windowID,"theScript","SELECTION","0,32000"¬  else if objValue = "Message" then¬    doMsg¬  else if objValue = "Next Window" then¬    doMenu "Next Window"¬  else if objName = "go" then¬    send "BringToFront" to window objValue¬  else if objValue = "Find…" then¬    global scriptFindString¬    ask "Find:" with scriptFindString¬    if it is not empty then¬      put it into scriptFindString¬      wsSet windowID,"theScript","SELECTIONTEXT",it¬    end if¬  else if objValue = "Find Again…" then¬    global scriptFindString¬    if scriptFindString is not empty then¬      wsSet windowID,"theScript","SELECTIONTEXT",scriptFindString¬    end if¬  else if ("A Property…" is in objValue) or (objValue="Send A Command…") then¬    put line 1 of the stacks into sk¬    put wsGet(windowID,"xOwnerID") into oID¬    push cd¬    lock screen¬    set lockmessages to true¬    go stack WSS¬    get line 2 of WindowScript((word 3 of objValue) & CR & "HitMessage: "&(word 1 of objValue)&"Hit", wsGet(oID,0,"itemList"))¬    pop cd¬    unlock screen ¬    set lockmessages to false¬    if it is not empty then¬      wsSet windowID,"theScript","TEXTOFSELECTION",it&return¬      get wsGet(windowID,"theScript","SELECTION")¬      wsSet windowID,"theScript","SELECTION",(item 2 of it) & "," & (item 2 of it)¬    end if¬  else if objValue = "Display A Window…" then  ¬    put wsGet(wsGet(wdID,0,"xOwnerID"),0,"xStackName") into sk¬    get ResourceList(sk,"LENS")¬    sort it¬    get WindowScript("Windows" & CR & "Delete_Visible: FALSE" & CR & "Open As Text_Visible: FALSE" & CR & "New_Visible: FALSE" & CR & "Open_Name: Show" & CR & "WindowList_Logic: Single",it)¬    if it is not empty then¬      put quote & line 3 of it & quote into theParams¬      put LENS2Text("",line 3 of it) into lensText¬      get offset(return&"Params:",lensText)¬      if it>0 then  ¬        put char it+8 to 32767 of lensText into part¬        get offset(return,part)¬        put ","&&scrunch(unscrunch(char 1 to it-1 of part),",") after theParams¬      end if¬      ¬      get "get WindowScript(" & theParams &")"¬      wsSet windowID,"theScript","TEXTOFSELECTION",it&return¬      get wsGet(windowID,"theScript","SELECTION")¬      wsSet windowID,"theScript","SELECTION",(item 2 of it) & "," & (item 2 of it)¬    end if¬  end if¬end if¬--end wEvent
  12. Params: i0_NAME¬i1_TEXT¬i1_SELECTION
  13. Menubar: ScriptBar
  14.  
  15. ItemType: TEXT
  16. Rect: -1,-1,461,186
  17. TextFont: Monaco
  18. TextSize: 9
  19. AutoSize: FALSE
  20. GrowItem: TRUE
  21. Name: theScript
  22. LockText: FALSE
  23. Scrolling: TRUE
  24. Script: set cursor to watch¬formatScript wsGet(wdID,"theScript","HANDLE")
  25.  
  26. ItemType: PUSH
  27. Rect: 135,1198,207,1218
  28. Name: OK
  29. DefaultItem: TRUE
  30. AutoClose: TRUE
  31. Script: doSaveScript wdName
  32.  
  33. ItemType: PUSH
  34. Rect: 135,1198,215,1218
  35. Name: Cancel
  36. CancelItem: TRUE
  37. AutoClose: TRUE
  38. Script: wsSet wdId,0,xOldScript,wsGet(wdID,"theScript","TEXT")